#ifndef DRAWLABEL_H
#define DRAWLABEL_H

#include <QObject>
#include <QWidget>
#include <QPen>
#include <QBrush>
#include <QMouseEvent>
#include <QPainter>
#include <QPaintEvent>
#include <QDebug>
#include "cal.h"
#include <QThread>
#include <QMessageBox>

class DrawLabel : public QWidget
{
    Q_OBJECT
public:
    explicit DrawLabel(QWidget *parent = nullptr);
    void paintEvent(QPaintEvent *);
    bool eventFilter(QObject *obj, QEvent *event);	// 添加时间过滤器声明
    void drawDot(QPainter *painter, QColor color, int size, int x, int y);
    void drawLine(QPainter *painter, QColor color, int startX, int startY, int endX, int endY);
    void drawDashLine(QPainter *painter, QColor color, int startX, int startY, int endX, int endY);
    void clearPoint();
signals:
    void signalClicked(int type, double x, double y);
public slots:
private:
    int w,h;
    int tx,ty;
    int pointCnt=0;
    int xa, ya;
    int xb, yb;
    int xc, yc;
    bool isA = false;
    bool isB = false;
    bool isC = false;
    Point B1, C1,A1,R;
};

#endif // DRAWLABEL_H
